package com.houseplatform.library.Inet;

import java.io.File;
import java.io.InputStream;


/**
 * 此接口是进行HTTP GET/POST的操作接口 此接口不处理线程等待的问题
 * 如果需要异步线程 请自行在调用类是实现异步
 * 当返回结果后用户应该判断 isError()是否为true
 *  如果为true 那么可以通过 getErrorMessage来获取错误消息
 * @author popo
 *
 */
public interface HttpTool {
	public boolean isError();	//网络连接是否有错误 
	public String getErrorMessage();	//返回连接错误
	public InputStream doGet(String url) throws Exception;	//最简单的执行Get请求
	public String doGetResponseMessage(String url) throws Exception;
	
	
	
	public InputStream doPost(String url) throws Exception;	//执行简单的POST请求
	public String doPostResponseMessage(String url) throws Exception;	//执行简单的POST请求
	public InputStream doPost(String url,String data) throws Exception;	//向服务器发送字符串请求
	public String doPostResponseMessage(String url,String data) throws Exception;	//向服务器发送字符串请求
	public InputStream doPost(String url,String data,File[] files) throws Exception;	
	public String doPostResponseMessage(String url,String data,File[] files) throws Exception;	
	
	
	public InputStream doPut(String url) throws Exception;	//执行简单的POST请求
	public String doPutResponseMessage(String url) throws Exception;	//执行简单的POST请求
	
}
